package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 设备维护表
 * @TableName equipment_maintenance
 */
@TableName(value ="equipment_maintenance")
@Data
public class EquipmentMaintenance implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 设备ID
     */
    private Long equipmentId;

    /**
     * 维护单号
     */
    private String maintenanceNo;

    /**
     * 维护类型(PREVENTIVE:预防性维护 REPAIR:维修)
     */
    private String maintenanceType;

    /**
     * 维护日期
     */
    private Date maintenanceDate;

    /**
     * 维护人员
     */
    private String maintenancePerson;

    /**
     * 维护费用
     */
    private BigDecimal cost;

    /**
     * 维护描述
     */
    private String description;

    /**
     * 维护结果
     */
    private String result;

    /**
     * 下次维护日期
     */
    private Date nextMaintenanceDate;

    /**
     * 状态(0:计划 1:进行中 2:完成)
     */
    private Integer status;

    /**
     * 租户ID
     */
    private Long tenantId;

    /**
     * 创建人
     */
    @TableField(exist = false)
    private Long createUser;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EquipmentMaintenance other = (EquipmentMaintenance) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getEquipmentId() == null ? other.getEquipmentId() == null : this.getEquipmentId().equals(other.getEquipmentId()))
            && (this.getMaintenanceNo() == null ? other.getMaintenanceNo() == null : this.getMaintenanceNo().equals(other.getMaintenanceNo()))
            && (this.getMaintenanceType() == null ? other.getMaintenanceType() == null : this.getMaintenanceType().equals(other.getMaintenanceType()))
            && (this.getMaintenanceDate() == null ? other.getMaintenanceDate() == null : this.getMaintenanceDate().equals(other.getMaintenanceDate()))
            && (this.getMaintenancePerson() == null ? other.getMaintenancePerson() == null : this.getMaintenancePerson().equals(other.getMaintenancePerson()))
            && (this.getCost() == null ? other.getCost() == null : this.getCost().equals(other.getCost()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()))
            && (this.getNextMaintenanceDate() == null ? other.getNextMaintenanceDate() == null : this.getNextMaintenanceDate().equals(other.getNextMaintenanceDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getTenantId() == null ? other.getTenantId() == null : this.getTenantId().equals(other.getTenantId()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getEquipmentId() == null) ? 0 : getEquipmentId().hashCode());
        result = prime * result + ((getMaintenanceNo() == null) ? 0 : getMaintenanceNo().hashCode());
        result = prime * result + ((getMaintenanceType() == null) ? 0 : getMaintenanceType().hashCode());
        result = prime * result + ((getMaintenanceDate() == null) ? 0 : getMaintenanceDate().hashCode());
        result = prime * result + ((getMaintenancePerson() == null) ? 0 : getMaintenancePerson().hashCode());
        result = prime * result + ((getCost() == null) ? 0 : getCost().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
        result = prime * result + ((getNextMaintenanceDate() == null) ? 0 : getNextMaintenanceDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getTenantId() == null) ? 0 : getTenantId().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", equipmentId=").append(equipmentId);
        sb.append(", maintenanceNo=").append(maintenanceNo);
        sb.append(", maintenanceType=").append(maintenanceType);
        sb.append(", maintenanceDate=").append(maintenanceDate);
        sb.append(", maintenancePerson=").append(maintenancePerson);
        sb.append(", cost=").append(cost);
        sb.append(", description=").append(description);
        sb.append(", result=").append(result);
        sb.append(", nextMaintenanceDate=").append(nextMaintenanceDate);
        sb.append(", status=").append(status);
        sb.append(", tenantId=").append(tenantId);
        sb.append(", createUser=").append(createUser);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}